CCX=g++
BIN=tests testLink instrumenteur
SRC=TestsBsf.cpp ../loggers/XmlLogger.cpp ../loggers/BinaryStandardFormatLogger.cpp ../compressors/CompressorProcess.h ../ipc/MESSAGE_QUEUE.cpp ../compressors/CompressorProcess.cpp ../stack_trace/stack_trace.cpp ../ipc/Pipe.cpp	

LIB=-L ../libs/ -I ../include/
FLAGS= -w -Wall -I ../include -I ../ipc/ -I ../compressors -lpthread

all:$(SRC) TestCodeC.c ../ipc/*.h ../ipc/*.cpp 
	@printf "\033[34;1m\nCompilation du test de la transformation binaire en XML.\n\033[m"
	$(CXX) $(FLAGS) -o tests $(SRC) -fopenmp
	@printf "\033[34;1m\nCompilation du test du linkage dynamique de la libInterposer.\n\033[m"
	$(CXX) $(LIB)   -o testLink TestCodeC.c ../stack_trace/stack_trace.cpp ../ipc/MESSAGE_QUEUE.cpp ../ipc/Pipe.cpp -lInterposerCpp 
	@printf "\033[34;1m\nCompilation de l'instrumenteur.\n\033[m"	
	$(CXX) $(FLAGS) -o instrumenteur instrumentateur.cpp ../compressors/CompressorProcess.cpp ../stack_trace/stack_trace.cpp ../ipc/Pipe.cpp ../ipc/MESSAGE_QUEUE.cpp 
	@printf "\033[34;1m\nCompilation du transformeur XML.\n\033[m"	
	$(CXX) $(FLAGS) -o xmltransformer XmlTransformer.cpp ../loggers/XmlLogger.cpp
	@printf "\033[34;1m\nCompilation du test de la communication par pipe.\n\033[m"	
	$(CXX) -g -rdynamic -I ../ipc/ -I ../include/ pipe.cpp ../ipc/Pipe.cpp ../stack_trace/stack_trace.cpp -o pipeTest
    clean:
	@printf "\033[34;1m\nCleaning.\n\033[m"
	rm -rf *.o *.bsf *~ tests *.xml $(BIN)
